import request from "@/utils/request";

export function getDepartments() {
  return request({
    // 出现了一个错误 就是 company出现了一个空格 导致url出现错误
    url: `/company/department`
    // method: "get"
  });
}
// export function getDepartments() {
//   return request({
//     url: '/company/department'
//   })
// }

export function delDepartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: "delete"
  });
}

/**
 * 新增部门接口
 */
export function addDepartments(data) {
  return request({
    url: `/company/department`,
    method: "post",
    data
  });
}

// 编辑方法
export function departmentDetile(id) {
  return request({
    url: `/company/department/${id}`
  });
}

// 编辑接口
export function updateDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: "put",
    data
  });
}
